Skip to content

feat: implement splitInteger function tests#1036

Open
mykhailokurochkin wants to merge 2 commits intomate-academy:mainfrom
mykhailokurochkin:develop
Open

feat: implement splitInteger function tests#1036
mykhailokurochkin wants to merge 2 commits intomate-academy:mainfrom
mykhailokurochkin:develop

Conversation

@mykhailokurochkin
Copy link

  • implement tests

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Great start on the tests for the splitInteger function! The tests you've written are clear and well-structured.

However, this submission requires a few changes because it's missing three of the four specific examples outlined in the task description. To complete the task, please add tests to verify the function's output for the following cases:

  • splitInteger(6, 2) should return [3, 3]
  • splitInteger(17, 4) should return [4, 4, 4, 5]
  • splitInteger(32, 6) should return [5, 5, 5, 5, 6, 6]

Ensuring all required examples are tested is crucial for verifying the function's correctness. Keep up the great work!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Important

Fix the issues, commit the changes, and then re-request my review using the Re-request review button2 in the Reviewers tab.

Tip

If you have any comments about this review, please leave a message in the Add a comment section below and mention me with the @mateacademy-ai-mentor tag3.
I will read your message during my next review of your pull request. Please do not reply directly to my comments, as that feature is not supported yet.

Caution

Do not close the pull request until the review is complete. Closing it early can lead to unexpected behavior and disrupt the review process.

Footnotes

  1. Rate AI review example

  2. Re-request AI review example

  3. Add AI review comments example

Comment on lines 5 to 29
test(`should split a number into equal parts
if a value is divisible by a numberOfParts`, () => {
const result = splitInteger(10, 5);

expect(result).toEqual([2, 2, 2, 2, 2]);
});

test(`should return a part equals to a value
when splitting into 1 part`, () => {
const result = splitInteger(8, 1);

expect(result).toEqual([8]);
});

test('should sort parts ascending if they are not equal', () => {
const result = splitInteger(5, 2);

expect(result).toEqual([2, 3]);
});

test('should add zeros if value < numberOfParts', () => {
const result = splitInteger(4, 5);

expect(result).toEqual([0, 1, 1, 1, 1]);
});

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good start on the tests! However, the task description provides four specific examples to test, and your test suite is missing three of them. It's important to ensure all specified examples are covered.

Please add tests to verify the output for the following cases:

  • splitInteger(6, 2) should return [3, 3]
  • splitInteger(17, 4) should return [4, 4, 4, 5]
  • splitInteger(32, 6) should return [5, 5, 5, 5, 6, 6]

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

Excellent work on this update! You've successfully addressed the feedback from the previous review by adding tests for all the required examples. Your test suite is now comprehensive and correctly validates the splitInteger function against the specifications. The submission fully meets all task requirements, and I am happy to approve it. Great job!


✨ Please rate this review in the Platform's notification center1. I will be grateful for your feedback! ✨

Footnotes

  1. Rate AI review example

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants